Add resource://mapbox-documentation with proper MIME type support#59
Merged
mattpodwysocki merged 1 commit intomainfrom Jan 27, 2026
Merged
Add resource://mapbox-documentation with proper MIME type support#59mattpodwysocki merged 1 commit intomainfrom
mattpodwysocki merged 1 commit intomainfrom
Conversation
- Create MapboxDocumentationResource that fetches docs from docs.mapbox.com/llms.txt - Returns content with mimeType: text/markdown for proper typing - Update GetMapboxDocSourceTool description to mention the resource - Add comprehensive tests for the new resource - Fix TypeScript error in GetReferenceTool (text type assertion) Provides proper MIME type support for clients that handle resources well, while keeping the tool for broad compatibility.
Contributor
Author
|
Does this create a conflict for the agent consuming the mcp? It effectively has context of a resource and a tool that do the same thing. |
Contributor
Author
@ctufts no, because it should use the resource first unless the agent doesn't support resources. |
Valiunia
approved these changes
Jan 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Adds
resource://mapbox-documentationas a proper MCP resource withtext/markdownMIME type, while keeping the existingget_latest_mapbox_docs_toolfor broad compatibility.Why This Matters
Following up on PR #58 which added the Accept header, this PR provides the full solution for clients that properly support MCP resources:
Tool (
get_latest_mapbox_docs_tool):type: 'text'(no MIME type)Resource (
resource://mapbox-documentation):mimeType: 'text/markdown'(properly typed)Changes
New Files:
src/resources/mapbox-documentation-resource/MapboxDocumentationResource.ts- Resource implementationtest/resources/mapbox-documentation-resource/MapboxDocumentationResource.test.ts- Comprehensive testsModified Files:
src/resources/resourceRegistry.ts- Register new resourcesrc/tools/get-mapbox-doc-source-tool/GetMapboxDocSourceTool.ts- Updated description to mention resourcesrc/tools/get-reference-tool/GetReferenceTool.ts- Fixed TypeScript type assertiontest/tools/__snapshots__/tool-naming-convention.test.ts.snap- Updated snapshotImplementation Details
The
MapboxDocumentationResource:https://docs.mapbox.com/llms.txttext/markdown, text/plain;q=0.9, */*;q=0.8)mimeType: 'text/markdown'Testing
User Experience
Users now have two ways to access documentation:
Call the tool (works everywhere):
Read the resource (better typing):
// Client reads resource://mapbox-documentationThe tool description mentions the resource for clients that support it:
Consistency
This follows the same pattern we use with:
resource://mapbox-style-layersresource://mapbox-streets-v8-fieldsresource://mapbox-token-scopesresource://mapbox-layer-type-mappingThe key difference is that this resource fetches from an external URL (docs.mapbox.com) rather than returning static content, making it always up-to-date.